import { axios } from '@/utils/request'

const api = {
    configApp: '/admin/configApp',
    configBanner: '/admin/configBanner',
    sysOptions: '/admin/sysOptions/list/getList',
    sysOptionsById: '/admin/sysOptions',

    configAppBasisData: '/admin/configAppBasisData',
    configAppBasisDataSwap: '/admin/configAppBasisData/swap',
    systemLinkList: '/admin/systemLink/list',

    configAppInformation: '/admin/configAppInformation',

    appAllList: '/admin/systemLink/appAllList',
    // 官网配置
    configWebsiteNavigationBar: '/admin/configWebsiteNavigationBar', //导航菜单
    configWebsite: '/admin/configWebsite', //全局配置
    //资讯动态
    configWebsiteInfoDynamic: '/admin/configWebsiteInfoDynamic',
    //会员服务
    configWebsiteMemberService: '/admin/configWebsiteMemberService',
    //楼层设置
    configWebsiteModule: '/admin/configWebsiteModule',
    //查询开启状态
    orgAiTenantConfig: '/admin/org-ai-tenant-config/getByInfo',
    //设置开启状态
    orgAiTenantConfigEnable: '/admin/org-ai-tenant-config/setEnable',
}

//  获取小程序全局配置
export function configApp() {
    return axios({
        url: api.configApp,
        method: 'get'
    })
}

//  保存小程序全局配置
export function saveConfigApp(data) {
    return axios({
        url: api.configApp,
        method: 'post',
        data
    })
}

//获取轮播列表
export function getConfigBanner(params) {
    return axios({
        url: api.configBanner + '/list',
        method: 'get',
        params
    })
}

//添加轮播图
export function addConfigBanner(data) {
    return axios({
        url: api.configBanner,
        method: 'post',
        data
    })
}

//修改轮播图
export function editConfigBanner(data) {
    return axios({
        url: api.configBanner,
        method: 'put',
        data
    })
}

//删除轮播图
export function delConfigBanner(id) {
    return axios({
        url: api.configBanner + `/${id}`,
        method: 'delete'
    })
}

//获取系统下拉选项
export function getSysOptions(params) {
    return axios({
        url: api.sysOptions,
        method: 'get',
        params
    })
}

//根据ID获取二级分类
export function getSysOptionsById(id) {
    return axios({
        url: api.sysOptionsById + `/${id}`,
        method: 'get'
    })
}

//获取分类设置、底部菜单栏列表
export function configAppBasisDataList(params) {
    return axios({
        url: api.configAppBasisData + '/list',
        method: 'get',
        params
    })
}
//新增分类设置、底部菜单栏
export function addConfigAppBasisData(data) {
    return axios({
        url: api.configAppBasisData,
        method: 'post',
        data
    })
}
//编辑分类设置、底部菜单栏
export function editConfigAppBasisData(data) {
    return axios({
        url: api.configAppBasisData,
        method: 'put',
        data
    })
}
//删除分类设置、底部菜单栏
export function delConfigAppBasisData(id) {
    return axios({
        url: api.configAppBasisData + `/${id}`,
        method: 'delete'
    })
}

//分类设置、底部菜单栏排序
export function configAppBasisDataSwap(data) {
    return axios({
        url: api.configAppBasisDataSwap,
        method: 'post',
        data
    })
}

//小程序底部菜单栏获取系统链接列表
export function systemLinkList(params) {
    return axios({
        url: api.systemLinkList,
        method: 'get',
        params
    })
}

//获取咨询设置列表
export function configAppInformationList() {
    return axios({
        url: api.configAppInformation + '/list',
        method: 'get'
    })
}

//新增咨询设置
export function addConfigAppInformation(data) {
    return axios({
        url: api.configAppInformation,
        method: 'post',
        data
    })
}

//修改咨询设置
export function editConfigAppInformation(data) {
    return axios({
        url: api.configAppInformation,
        method: 'put',
        data
    })
}

//删除咨询设置
export function delConfigAppInformation(id) {
    return axios({
        url: api.configAppInformation + `/${id}`,
        method: 'delete'
    })
}

//获取公共链接数据
export function AppAllList() {
    return axios({
        url: api.appAllList,
        method: 'get'
    })
}

//查询导航栏列表
export function configWebsiteNavigationBarList() {
    return axios({
        url: api.configWebsiteNavigationBar + '/list',
        method: 'get'
    })
}

//修改导航栏启用状态
export function configWebsiteNavigationBarEdit(data) {
    return axios({
        url: api.configWebsiteNavigationBar + '/enable',
        method: 'post',
        data
    })
}

//查询官网动态资讯
export function configWebsiteInfoDynamic() {
    return axios({
        url: api.configWebsiteInfoDynamic,
        method: 'get',
    })
}

//保存官网动态资讯
export function saveConfigWebsiteInfoDynamic(data) {
    return axios({
        url: api.configWebsiteInfoDynamic,
        method: 'post',
        data
    })
}

//查询会员服务列表
export function configWebsiteMemberService(params) {
    return axios({
        url: api.configWebsiteMemberService + '/list',
        method: 'get',
        params
    })
}

//添加会员服务
export function addConfigWebsiteMemberService(data) {
    return axios({
        url: api.configWebsiteMemberService,
        method: 'post',
        data
    })
}

//修改会员服务
export function editConfigWebsiteMemberService(data) {
    return axios({
        url: api.configWebsiteMemberService,
        method: 'put',
        data
    })
}

//删除会员服务
export function delConfigWebsiteMemberService(id) {
    return axios({
        url: api.configWebsiteMemberService + `/${id}`,
        method: 'delete'
    })
}

//楼层列表
export function configWebsiteModule() {
    return axios({
        url: api.configWebsiteModule + `/list`,
        method: 'get'
    })
}

//查询官网全局配置
export function getConfigWebsite() {
    return axios({
        url: api.configWebsite,
        method: 'get',
    })
}

//保存官网全局配置
export function setConfigWebsite(data) {
    return axios({
        url: api.configWebsite,
        method: 'post',
        data
    })
}

//查询开启状态
export function getOrgAiTenantConfig() {
    return axios({
        url: api.orgAiTenantConfig,
        method: 'get'
    })
}

//设置开启状态
export function setOrgAiTenantConfigEnable(enable) {
    return axios({
        url: api.orgAiTenantConfigEnable + `/${enable}`,
        method: 'post',
    })
}

